<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>(abstraction-rtos)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">(abstraction-rtos)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__worker__thread__util.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Worker Thread Utility</div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >Worker thread utility that allows functions to be run a different thread context. </p>
<p >This utility can be used to delegate work that is not timing critical. For example, scheduling work in interrupt handlers to keep handler execution times low or if some work needs to be done at a different priority. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcy__worker__thread__params__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__params__t">cy_worker_thread_params_t</a></td></tr>
<tr class="memdesc:structcy__worker__thread__params__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Worker Thread Parameters.  <a href="group__group__worker__thread__util.html#structcy__worker__thread__params__t">More...</a><br /></td></tr>
<tr class="separator:structcy__worker__thread__params__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structcy__worker__thread__info__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t">cy_worker_thread_info_t</a></td></tr>
<tr class="memdesc:structcy__worker__thread__info__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Worker Thread Information.  <a href="group__group__worker__thread__util.html#structcy__worker__thread__info__t">More...</a><br /></td></tr>
<tr class="separator:structcy__worker__thread__info__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gae45bcc8cd62f58eb236ef486b4d5558c"><td class="memItemLeft" align="right" valign="top"><a id="gae45bcc8cd62f58eb236ef486b4d5558c" name="gae45bcc8cd62f58eb236ef486b4d5558c"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CY_WORKER_THREAD_DEFAULT_NAME</b>&#160;&#160;&#160;&quot;CYWorker&quot;</td></tr>
<tr class="memdesc:gae45bcc8cd62f58eb236ef486b4d5558c"><td class="mdescLeft">&#160;</td><td class="mdescRight">&lt; Default worker thread name <br /></td></tr>
<tr class="separator:gae45bcc8cd62f58eb236ef486b4d5558c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae442fac806ebf74e3ba623a2c2e2ae1b"><td class="memItemLeft" align="right" valign="top"><a id="gae442fac806ebf74e3ba623a2c2e2ae1b" name="gae442fac806ebf74e3ba623a2c2e2ae1b"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CY_WORKER_DEFAULT_ENTRIES</b>&#160;&#160;&#160;(16)</td></tr>
<tr class="memdesc:gae442fac806ebf74e3ba623a2c2e2ae1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default number of work items in the queue. <br /></td></tr>
<tr class="separator:gae442fac806ebf74e3ba623a2c2e2ae1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaad1bf39d72a75351866a1871779dcaf8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__worker__thread__util.html#gaad1bf39d72a75351866a1871779dcaf8">CY_WORKER_THREAD_ERR_THREAD_INVALID</a>&#160;&#160;&#160;    CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 32)</td></tr>
<tr class="memdesc:gaad1bf39d72a75351866a1871779dcaf8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Additional work cannot be enqueued because the worker thread has been terminated.  <a href="group__group__worker__thread__util.html#gaad1bf39d72a75351866a1871779dcaf8">More...</a><br /></td></tr>
<tr class="separator:gaad1bf39d72a75351866a1871779dcaf8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gaeb4fb0e41f7d0092cc135f7cc5e41250"><td class="memItemLeft" align="right" valign="top"><a id="gaeb4fb0e41f7d0092cc135f7cc5e41250" name="gaeb4fb0e41f7d0092cc135f7cc5e41250"></a>
typedef void()&#160;</td><td class="memItemRight" valign="bottom"><b>cy_worker_thread_func_t</b>(void *arg)</td></tr>
<tr class="memdesc:gaeb4fb0e41f7d0092cc135f7cc5e41250"><td class="mdescLeft">&#160;</td><td class="mdescRight">Worker thread function call prototype <br  />
 <br /></td></tr>
<tr class="separator:gaeb4fb0e41f7d0092cc135f7cc5e41250"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga514bc54aa543a69ce1768903b9851473"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__worker__thread__util.html#ga514bc54aa543a69ce1768903b9851473">cy_worker_thread_state_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__worker__thread__util.html#gga514bc54aa543a69ce1768903b9851473a0d938b2d088126d6d47c936040e843c2">CY_WORKER_THREAD_INVALID</a>
, <br />
&#160;&#160;<a class="el" href="group__group__worker__thread__util.html#gga514bc54aa543a69ce1768903b9851473aec127b9642db106c61c3c32106fb69fb">CY_WORKER_THREAD_VALID</a>
, <br />
&#160;&#160;<a class="el" href="group__group__worker__thread__util.html#gga514bc54aa543a69ce1768903b9851473a5b1b5a7751c0460c908bfbb65cb7be08">CY_WORKER_THREAD_ENQUEUING</a>
, <br />
&#160;&#160;<a class="el" href="group__group__worker__thread__util.html#gga514bc54aa543a69ce1768903b9851473a79db794eee56f8188a116ed31ae5b1d4">CY_WORKER_THREAD_TERMINATING</a>
, <br />
&#160;&#160;<a class="el" href="group__group__worker__thread__util.html#gga514bc54aa543a69ce1768903b9851473a8685271e73d4fc9bc13e62a58a8431c8">CY_WORKER_THREAD_JOIN_COMPLETE</a>
<br />
 }</td></tr>
<tr class="memdesc:ga514bc54aa543a69ce1768903b9851473"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thread state enumeration.  <a href="group__group__worker__thread__util.html#ga514bc54aa543a69ce1768903b9851473">More...</a><br /></td></tr>
<tr class="separator:ga514bc54aa543a69ce1768903b9851473"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga383f418c20f7ae9d2eb184722b7bbd04"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__worker__thread__util.html#ga383f418c20f7ae9d2eb184722b7bbd04">cy_worker_thread_create</a> (<a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t">cy_worker_thread_info_t</a> *new_worker, const <a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__params__t">cy_worker_thread_params_t</a> *params)</td></tr>
<tr class="memdesc:ga383f418c20f7ae9d2eb184722b7bbd04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create worker thread to handle running callbacks in a separate thread.  <a href="group__group__worker__thread__util.html#ga383f418c20f7ae9d2eb184722b7bbd04">More...</a><br /></td></tr>
<tr class="separator:ga383f418c20f7ae9d2eb184722b7bbd04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae4a9787d87626fefc16e328754182c37"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__worker__thread__util.html#gae4a9787d87626fefc16e328754182c37">cy_worker_thread_delete</a> (<a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t">cy_worker_thread_info_t</a> *old_worker)</td></tr>
<tr class="memdesc:gae4a9787d87626fefc16e328754182c37"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete worker thread.  <a href="group__group__worker__thread__util.html#gae4a9787d87626fefc16e328754182c37">More...</a><br /></td></tr>
<tr class="separator:gae4a9787d87626fefc16e328754182c37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4a582d807e3b7d4fa0bf7ee770af9015"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__worker__thread__util.html#ga4a582d807e3b7d4fa0bf7ee770af9015">cy_worker_thread_enqueue</a> (<a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t">cy_worker_thread_info_t</a> *worker_info, <a class="el" href="group__group__worker__thread__util.html#gaeb4fb0e41f7d0092cc135f7cc5e41250">cy_worker_thread_func_t</a> *work_func, void *arg)</td></tr>
<tr class="memdesc:ga4a582d807e3b7d4fa0bf7ee770af9015"><td class="mdescLeft">&#160;</td><td class="mdescRight">Queue work on a worker thread.  <a href="group__group__worker__thread__util.html#ga4a582d807e3b7d4fa0bf7ee770af9015">More...</a><br /></td></tr>
<tr class="separator:ga4a582d807e3b7d4fa0bf7ee770af9015"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcy__worker__thread__params__t" id="structcy__worker__thread__params__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcy__worker__thread__params__t">&#9670;&nbsp;</a></span>cy_worker_thread_params_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cy_worker_thread_params_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="ae02e3a16a65e7bb72e10647beceb1fac" name="ae02e3a16a65e7bb72e10647beceb1fac"></a><a class="el" href="group__group__abstraction__rtos__port.html#ga9f21bb78897c25df019b6e4286ecc7a0">cy_thread_priority_t</a></td>
<td class="fieldname">
priority</td>
<td class="fielddoc">
Requested thread priority. </td></tr>
<tr><td class="fieldtype">
<a id="a1ab40c8bd034655877e583026cfb20ff" name="a1ab40c8bd034655877e583026cfb20ff"></a>uint32_t</td>
<td class="fieldname">
stack_size</td>
<td class="fielddoc">
Size of stack for new thread. <p >Note that this must be atleast CY_RTOS_MIN_STACK_SIZE </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a7dcafa34217aecb4f6745d162b20a256" name="a7dcafa34217aecb4f6745d162b20a256"></a>uint8_t *</td>
<td class="fieldname">
stack</td>
<td class="fielddoc">
Pointer to stack. <p >If this is NULL a stack of size <a class="el" href="group__group__worker__thread__util.html#a1ab40c8bd034655877e583026cfb20ff">stack_size</a> will be allocated. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a31710f19616d90ca7ccd2076287bb028" name="a31710f19616d90ca7ccd2076287bb028"></a>const char *</td>
<td class="fieldname">
name</td>
<td class="fielddoc">
Thread name. <p >If set to NULL, <a class="el" href="group__group__worker__thread__util.html#gae45bcc8cd62f58eb236ef486b4d5558c">CY_WORKER_THREAD_DEFAULT_NAME</a> will be used. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="ae0bee3f6b0c9b3250e7b3bba2a6fb012" name="ae0bee3f6b0c9b3250e7b3bba2a6fb012"></a>uint32_t</td>
<td class="fieldname">
num_entries</td>
<td class="fielddoc">
Maximum number of enteries the worker thread can queue. <p >If set to 0, <a class="el" href="group__group__worker__thread__util.html#gae442fac806ebf74e3ba623a2c2e2ae1b">CY_WORKER_DEFAULT_ENTRIES</a> will be used. <br  />
 </p>
</td></tr>
</table>

</div>
</div>
<a name="structcy__worker__thread__info__t" id="structcy__worker__thread__info__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcy__worker__thread__info__t">&#9670;&nbsp;</a></span>cy_worker_thread_info_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cy_worker_thread_info_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="af921b846c4cdb4ee1b4de6267ae2c2a2" name="af921b846c4cdb4ee1b4de6267ae2c2a2"></a><a class="el" href="group__group__abstraction__rtos__port.html#gac3dcb8e5a19cd138761a6548dd4de50f">cy_queue_t</a></td>
<td class="fieldname">
event_queue</td>
<td class="fielddoc">
Event Queue for this thread. </td></tr>
<tr><td class="fieldtype">
<a id="ab2f74dcd0e41ac82b69e15317912dc56" name="ab2f74dcd0e41ac82b69e15317912dc56"></a>uint32_t</td>
<td class="fieldname">
enqueue_count</td>
<td class="fielddoc">
Number of conccurent enqueue requests. </td></tr>
<tr><td class="fieldtype">
<a id="a1efa83728c9763f3738676b959236347" name="a1efa83728c9763f3738676b959236347"></a><a class="el" href="group__group__abstraction__rtos__port.html#ga27c9e935c4c4f200d86a8484d3db08d3">cy_thread_t</a></td>
<td class="fieldname">
thread</td>
<td class="fielddoc">
Thread object <br  />
 </td></tr>
<tr><td class="fieldtype">
<a id="a684566a02021807ad40ebdddf3e38def" name="a684566a02021807ad40ebdddf3e38def"></a><a class="el" href="group__group__worker__thread__util.html#ga514bc54aa543a69ce1768903b9851473">cy_worker_thread_state_t</a></td>
<td class="fieldname">
state</td>
<td class="fielddoc">
State of the worker thread <br  />
 </td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="gaad1bf39d72a75351866a1871779dcaf8" name="gaad1bf39d72a75351866a1871779dcaf8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaad1bf39d72a75351866a1871779dcaf8">&#9670;&nbsp;</a></span>CY_WORKER_THREAD_ERR_THREAD_INVALID</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CY_WORKER_THREAD_ERR_THREAD_INVALID&#160;&#160;&#160;    CY_RSLT_CREATE(CY_RSLT_TYPE_ERROR, CY_RSLT_MODULE_ABSTRACTION_OS, 32)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Additional work cannot be enqueued because the worker thread has been terminated. </p>
<p >This can occur if <a class="el" href="group__group__worker__thread__util.html#ga383f418c20f7ae9d2eb184722b7bbd04">cy_worker_thread_create</a> was not called or <a class="el" href="group__group__worker__thread__util.html#gae4a9787d87626fefc16e328754182c37">cy_worker_thread_delete</a> was called before calling <a class="el" href="group__group__worker__thread__util.html#ga4a582d807e3b7d4fa0bf7ee770af9015">cy_worker_thread_enqueue</a> </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga514bc54aa543a69ce1768903b9851473" name="ga514bc54aa543a69ce1768903b9851473"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga514bc54aa543a69ce1768903b9851473">&#9670;&nbsp;</a></span>cy_worker_thread_state_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__worker__thread__util.html#ga514bc54aa543a69ce1768903b9851473">cy_worker_thread_state_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Thread state enumeration. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga514bc54aa543a69ce1768903b9851473a0d938b2d088126d6d47c936040e843c2" name="gga514bc54aa543a69ce1768903b9851473a0d938b2d088126d6d47c936040e843c2"></a>CY_WORKER_THREAD_INVALID&#160;</td><td class="fielddoc"><p >Worker Thread is in invalid state <br  />
 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga514bc54aa543a69ce1768903b9851473aec127b9642db106c61c3c32106fb69fb" name="gga514bc54aa543a69ce1768903b9851473aec127b9642db106c61c3c32106fb69fb"></a>CY_WORKER_THREAD_VALID&#160;</td><td class="fielddoc"><p >Worker Thread is in valid state <br  />
 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga514bc54aa543a69ce1768903b9851473a5b1b5a7751c0460c908bfbb65cb7be08" name="gga514bc54aa543a69ce1768903b9851473a5b1b5a7751c0460c908bfbb65cb7be08"></a>CY_WORKER_THREAD_ENQUEUING&#160;</td><td class="fielddoc"><p >Worker Thread is adding to the queue <br  />
 </p>
</td></tr>
<tr><td class="fieldname"><a id="gga514bc54aa543a69ce1768903b9851473a79db794eee56f8188a116ed31ae5b1d4" name="gga514bc54aa543a69ce1768903b9851473a79db794eee56f8188a116ed31ae5b1d4"></a>CY_WORKER_THREAD_TERMINATING&#160;</td><td class="fielddoc"><p >Worker Thread is starting to terminate. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga514bc54aa543a69ce1768903b9851473a8685271e73d4fc9bc13e62a58a8431c8" name="gga514bc54aa543a69ce1768903b9851473a8685271e73d4fc9bc13e62a58a8431c8"></a>CY_WORKER_THREAD_JOIN_COMPLETE&#160;</td><td class="fielddoc"><p >Worker Thread join is complete <br  />
 </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga383f418c20f7ae9d2eb184722b7bbd04" name="ga383f418c20f7ae9d2eb184722b7bbd04"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga383f418c20f7ae9d2eb184722b7bbd04">&#9670;&nbsp;</a></span>cy_worker_thread_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_worker_thread_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t">cy_worker_thread_info_t</a> *&#160;</td>
          <td class="paramname"><em>new_worker</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__params__t">cy_worker_thread_params_t</a> *&#160;</td>
          <td class="paramname"><em>params</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create worker thread to handle running callbacks in a separate thread. </p>
<dl class="section note"><dt>Note</dt><dd>Calling this function twice on the same thread object ( <a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t">cy_worker_thread_info_t</a>) without calling <a class="el" href="group__group__worker__thread__util.html#gae4a9787d87626fefc16e328754182c37">cy_worker_thread_delete</a> will cause memory leakage.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">new_worker</td><td>pointer to <a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t" title="Worker Thread Information.">cy_worker_thread_info_t</a> structure to be filled when created. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">params</td><td>pointer to requested parameters for starting worker thread.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the worker thread creation request. </dd></dl>

</div>
</div>
<a id="gae4a9787d87626fefc16e328754182c37" name="gae4a9787d87626fefc16e328754182c37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae4a9787d87626fefc16e328754182c37">&#9670;&nbsp;</a></span>cy_worker_thread_delete()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_worker_thread_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t">cy_worker_thread_info_t</a> *&#160;</td>
          <td class="paramname"><em>old_worker</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Delete worker thread. </p>
<dl class="section note"><dt>Note</dt><dd>This function will wait for the thread to complete all pending work in the queue and exit before returning.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">old_worker</td><td>pointer to <a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t" title="Worker Thread Information.">cy_worker_thread_info_t</a> structure to be deleted.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the deletion of the worker thread. </dd></dl>

</div>
</div>
<a id="ga4a582d807e3b7d4fa0bf7ee770af9015" name="ga4a582d807e3b7d4fa0bf7ee770af9015"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4a582d807e3b7d4fa0bf7ee770af9015">&#9670;&nbsp;</a></span>cy_worker_thread_enqueue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_worker_thread_enqueue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__worker__thread__util.html#structcy__worker__thread__info__t">cy_worker_thread_info_t</a> *&#160;</td>
          <td class="paramname"><em>worker_info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__worker__thread__util.html#gaeb4fb0e41f7d0092cc135f7cc5e41250">cy_worker_thread_func_t</a> *&#160;</td>
          <td class="paramname"><em>work_func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Queue work on a worker thread. </p>
<p >Call the given function in the worker thread context.</p>
<dl class="section note"><dt>Note</dt><dd>If the thread priority is below that of the current thread, you must yield to allow the worker thread to run. This can be done by calling <a class="el" href="group__group__abstraction__rtos__time.html#gaa33d9f3026f722ac92950c6215e4283a">cy_rtos_delay_milliseconds</a> or by waiting on an RTOS object in all higher priority threads.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">worker_info</td><td>pointer to worker_thread used to run function </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">work_func</td><td>function to run </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">arg</td><td>opaque arg to be used in function call</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the queueing of work. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>(abstraction-rtos)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
